Skip to content

Translate the setup form from Omarchy's catalogs and let callers give a timezone fallback - #16049

Merged
dhh merged 1 commit into
quattrofrom
setup-form-language
Oct 24, 2026
Merged

dhh merged 1 commit into
quattrofrom
setup-form-language

Conversation

@omarchybot

@omarchybot omarchybot commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

The setup form in install/provisioning/setup-form.sh is shared by the ISO installer and first-boot owner setup. It spoke only English and could only guess a timezone from the network. omacom/omarchy-iso#297 (merged) gave the installer a language picker, and it needs the form to speak that language and fall back to a sensible timezone. Without this, the ISO has to rewrite gum's arguments by matching the form's English text and shadow tzupdate with a function, so every wording change here silently breaks the ISO.

  • Text. Every string the form shows is a setupForm.* key in default/i18n/en/cli.json, read through omarchy_form_text in the language the caller names in OMARCHY_FORM_LANGUAGE. English fills any key a language lacks, and anything that is not a registry code means English.
    • The lookup is a small jq call of the form's own, not omarchy-i18n, because the live ISO carries the catalogs (they ship in the settings package) but not bin/, and it has no user language file.
    • First-boot owner setup sets no language and stays English: its console font cannot draw most of these languages.
  • Translations. 35 languages already had these strings in the ISO's catalogs, written short enough for the console. They move here with their manifest entries, so the sync leaves them until the English changes and fills in the other languages. i18n-test.sh counts the form's omarchy_form_text calls as references to its keys.
  • Defaults. OMARCHY_FORM_KEYBOARD_DEFAULT and OMARCHY_FORM_TIMEZONE_DEFAULT from Let install media preset the language, keyboard and timezone #15522 stay as they are. A new OMARCHY_FORM_TIMEZONE_FALLBACK is preselected only when the network's guess fails, after the geo.omarchy.org lookup, so the installer can offer the chosen language's capital offline without overriding a working guess.
  • Git identity. The identity prompt keeps its English. Since Ask for the git identity after first login, with GitHub sign-in #16288 only ISO configurators from before omarchy-setup-git call it, and those never name a language.
  • Tests. setup-form-test.sh covers the caller's language, the English fallback, a malformed language code, and the fallback's place after the network guess. It now reads this checkout's catalogs rather than the machine's.

omacom/omarchy-iso#299 is the ISO side, which sets these variables and drops its interception.

Rebuilt on quattro as a single commit, now that #15522 is merged, on top of the geo.omarchy.org lookup (#16240) and the identity change (#16288). Codex Medium reviewed an earlier version together with the ISO changes. It found the form's translations would have disappeared if only English moved here, so they are carried over. Its agreement is not guaranteed to be independent.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The shared setup form reads translated prompts from Omarchy’s catalogs and accepts a caller-provided timezone fallback.

  • The setup form uses the caller’s language for its prompts and feedback.
  • The setup form uses a caller’s timezone when earlier guesses are missing.

No actionable issues were found. Review checks were static; automated tests and visual checks were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Timezone prompt] --> B{Preset provided?}
  B -->|Yes| E[Preselect preset]
  B -->|No| C{Network guess available?}
  C -->|Yes| F[Preselect network guess]
  C -->|No| D{Caller fallback provided?}
  D -->|Yes| G[Preselect fallback]
  D -->|No| H[Show timezone filter]
Loading

Reviews (3) · Last reviewed commit: "Translate the setup form from Omarchy's ..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator Author

Opened for omacom/omarchy-iso#297's language picker, stacked on #15522 at aade5e3, so it keeps the comma escaping in the keyboard preselection. The form now reads setupForm.* from cli.json in OMARCHY_FORM_LANGUAGE, with English filling in, and preselects OMARCHY_FORM_TIMEZONE_FALLBACK when the network can't guess. The 35 translations the ISO already had move in with their manifest entries. setup-form-test.sh and the structural i18n-test.sh pass. The full-mode i18n test fails on da/menu.json exactly as it does on #15522's head. Proven on the edge ISO in a VM through omacom/omarchy-iso#299.

Base automatically changed from install-language-preset to quattro October 20, 2026 15:14
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Merged quattro (with #15522 squash-merged) in as 150c8ed. The conflicts in setup-form.sh and its test were this PR's own additions on top of the squashed copy, so I kept this PR's side. On a worker, setup-form (22 passed) and install-language tests pass. The one i18n failure (da/menu.json mirrors the English catalog) also fails on quattro.

… a timezone fallback

The ISO installer asks for a language first, but the setup form it shares
with first-boot owner setup only speaks English, so the ISO had to swap
its strings by their English text on the way to gum. The form now reads
its strings from cli.json through omarchy_form_text, in the language the
caller names in OMARCHY_FORM_LANGUAGE, with English filling in. The live
ISO carries the catalogs but no omarchy-i18n and no user language file,
which is why the caller names it. First-boot owner setup leaves it unset
and stays English.

OMARCHY_FORM_TIMEZONE_FALLBACK stands in when geo.omarchy.org can't place
the machine, so the ISO can preselect the language's capital offline.

The translations for the 35 languages the ISO's console can draw come
over from the ISO's catalogs. The git identity prompt stays English: only
ISO configurators from before omarchy-setup-git still call it, and they
never name a language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh force-pushed the setup-form-language branch from 150c8ed to 250957a Compare October 24, 2026 19:52
dhh added a commit to omacom/omarchy-iso that referenced this pull request Oct 24, 2026
…staller

With omacom/omarchy#16049 the shared setup form reads its strings from
Omarchy's catalogs in the language its caller names, and preselects a
caller's timezone fallback when geo.omarchy.org can't place the machine.
The configurator names the picked language in OMARCHY_FORM_LANGUAGE, the
layout that goes with it in OMARCHY_FORM_KEYBOARD_DEFAULT and its
country's capital in OMARCHY_FORM_TIMEZONE_FALLBACK.

That retires the gum() wrapper that swapped the form's English text for
translations and fixed up the keyboard list's --selected, the reverse
dictionary behind it in i18n.sh, the form.* keys in every catalog, and
the configurator's own geo lookup with its tzupdate stand-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh merged commit 4fa93e9 into quattro Oct 24, 2026
2 checks passed
@dhh
dhh deleted the setup-form-language branch October 24, 2026 19:59
dhh added a commit to omacom/omarchy-iso that referenced this pull request Oct 24, 2026
…staller (#299)

* Let the setup form translate itself and take its defaults from the installer

With omacom/omarchy#16049 the shared setup form reads its strings from
Omarchy's catalogs in the language its caller names, and preselects a
caller's timezone fallback when geo.omarchy.org can't place the machine.
The configurator names the picked language in OMARCHY_FORM_LANGUAGE, the
layout that goes with it in OMARCHY_FORM_KEYBOARD_DEFAULT and its
country's capital in OMARCHY_FORM_TIMEZONE_FALLBACK.

That retires the gum() wrapper that swapped the form's English text for
translations and fixed up the keyboard list's --selected, the reverse
dictionary behind it in i18n.sh, the form.* keys in every catalog, and
the configurator's own geo lookup with its tzupdate stand-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Test what the configurator hands the setup form for a language

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
emirb added a commit that referenced this pull request Oct 30, 2026
)

* Let the installer's timezone picker always be searched by typing

The timezone prompt used gum choose whenever it had a guess, and gum
choose takes no typed text. Since the setup form gained a timezone
fallback (#16049) and omarchy-iso passes the language's capital or UTC,
there is always a guess, so no installer user can type a city. With
Europe/Amsterdam as the guess, typing "tokyo" moves the cursor up on
the "k", and Enter then sets Etc/Zulu.

The prompt now always opens gum filter, with the guess as the search
text. Enter takes the guess, and erasing it searches all zones. In
gum 2.0.2 every one of the 598 zones of tzdata 2026e ranks first for
its own exact name, so the guess is the highlighted row.

--selected is left out on purpose. At limit 1, gum filter prints the
--selected entry even after the user searched for another zone and
pressed Enter on it.

* List the timezone guess first instead of typing it into the search

With the guess as the search text, the user had to erase it before
searching. Most people start typing straight away. Typing "london"
after the guess Europe/Amsterdam searched "Europe/Amsterdamlondon",
which matches no zone, so Enter set UTC.

The guess now leads the list and the search starts empty. Enter takes
the guess, and the first key typed starts a new search of every zone.
A guess that is not a zone timedatectl lists is left out, as gum
choose --selected ignored one before.

The test now checks the guess is the first entry, listed once, and
that the call has neither --value nor --selected.

* Reject multiline timezone guesses before reordering the list

The whole-line membership pattern also matches adjacent lines. A
malformed guess with two real zones therefore promotes both, and a
guess containing the whole list makes grep return 1 under set -e.

Reject embedded newlines before testing membership. Add checks for
adjacent zones and the whole list. The adjacent-zone check fails on
the previous commit. All 23 setup-form test groups pass in the booted
rc2 ISO, and typing Lon then Enter returns Europe/London.
localrobot pushed a commit to localrobot/omarchy that referenced this pull request Nov 3, 2026
…com#17040)

* Let the installer's timezone picker always be searched by typing

The timezone prompt used gum choose whenever it had a guess, and gum
choose takes no typed text. Since the setup form gained a timezone
fallback (omacom#16049) and omarchy-iso passes the language's capital or UTC,
there is always a guess, so no installer user can type a city. With
Europe/Amsterdam as the guess, typing "tokyo" moves the cursor up on
the "k", and Enter then sets Etc/Zulu.

The prompt now always opens gum filter, with the guess as the search
text. Enter takes the guess, and erasing it searches all zones. In
gum 2.0.2 every one of the 598 zones of tzdata 2026e ranks first for
its own exact name, so the guess is the highlighted row.

--selected is left out on purpose. At limit 1, gum filter prints the
--selected entry even after the user searched for another zone and
pressed Enter on it.

* List the timezone guess first instead of typing it into the search

With the guess as the search text, the user had to erase it before
searching. Most people start typing straight away. Typing "london"
after the guess Europe/Amsterdam searched "Europe/Amsterdamlondon",
which matches no zone, so Enter set UTC.

The guess now leads the list and the search starts empty. Enter takes
the guess, and the first key typed starts a new search of every zone.
A guess that is not a zone timedatectl lists is left out, as gum
choose --selected ignored one before.

The test now checks the guess is the first entry, listed once, and
that the call has neither --value nor --selected.

* Reject multiline timezone guesses before reordering the list

The whole-line membership pattern also matches adjacent lines. A
malformed guess with two real zones therefore promotes both, and a
guess containing the whole list makes grep return 1 under set -e.

Reject embedded newlines before testing membership. Add checks for
adjacent zones and the whole list. The adjacent-zone check fails on
the previous commit. All 23 setup-form test groups pass in the booted
rc2 ISO, and typing Lon then Enter returns Europe/London.

(cherry picked from commit 7f4b1dd)
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants